import request from '@/config/axios'

// 销售出库主 VO
export interface Rdrecord32VO {
  id: number // id
  serialNumber: string // 流水号
  personId: number // 业务员id
  deptId: number // 部门id
  warehouseId: number // 仓库id
  orderDate: Date // 订单日期
  remark: string // 备注
  saleOrderId: number // 销售订单ID
}

// 销售出库主 API
export const Rdrecord32Api = {
  // 查询销售出库主分页
  getRdrecord32Page: async (params: any) => {
    return await request.get({ url: `/wms/rdrecord32/page`, params })
  },

  // 查询销售出库主详情
  getRdrecord32: async (id: number) => {
    return await request.get({ url: `/wms/rdrecord32/get?id=` + id })
  },

  // 新增销售出库主
  createRdrecord32: async (data: Rdrecord32VO) => {
    return await request.post({ url: `/wms/rdrecord32/create`, data })
  },

  // 修改销售出库主
  updateRdrecord32: async (data: Rdrecord32VO) => {
    return await request.put({ url: `/wms/rdrecord32/update`, data })
  },

  // 删除销售出库主
  deleteRdrecord32: async (id: number) => {
    return await request.delete({ url: `/wms/rdrecord32/delete?id=` + id })
  },

  // 导出销售出库主 Excel
  exportRdrecord32: async (params) => {
    return await request.download({ url: `/wms/rdrecord32/export-excel`, params })
  },
       //提交
       submit: async (id: number) => {
        return await request.get({ url: `/wms/rdrecord32/startProcess?id=` + id })
      },
// ==================== 子表（销售出库子） ====================

  // 获得销售出库子列表
  getRdrecords32ListByPid: async (pid) => {
    return await request.get({ url: `/wms/rdrecord32/rdrecords32/list-by-pid?pid=` + pid })
  },
}
